<template>
  <div>
    <div v-for="(item,index) of categoryList" :key="index">
      <div class="item">
        <span class=" icon"></span>
        <span>{{item.title}}</span>
      </div>
      <div v-if="item.children" class="child-item">
        <detail-List :categoryList="item.children"></detail-List>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "DetailList",
  props:{
    categoryList:{
      type:Array
    }
  }
};
</script>
<style lang="scss" scoped>
@import '~@/assets/style/global.scss';
.icon{
  width: 50px;
  height: 50px;
  // border: 1px solid#333;
  display: block;
  background: url("~@/assets/icon/detail.png" ) no-repeat;
  background-size: 50px;
  background-position:5px -52px;
  margin:0 30px;
}
.item{
  @include flexCenter;
  color: #333;
  border-bottom: 1px solid#eee;
  line-height: 90px;
}
.child-item{
  margin-left: 30px;
}
</style>
